import React, { Component } from 'react';
import { withRouter } from 'react-router';
import { renderRoutes } from 'react-router-config';
import Operating from 'jdcloudecc/components/Operating/Operating';

@withRouter
export default class App extends Component {
  constructor(props, context) {
    super(props, context);
  }
  
  render() {
    const { route } = this.props;

    var currentMenu = route.routes.filter((item) =>{ 
      return item.path == this.props.location.pathname;
    });

    return (
    	  <Operating menuUrl={ currentMenu && currentMenu[0] && currentMenu[0].menuUrl || '' }>
          {renderRoutes(route.routes)}
    	  </Operating>
    );
  }
}
